const express = require('express');
const router = express.Router();
const { adminAuth } = require('../middleware/auth');
const {
  getUsers,
  updateUser,
  deleteUser,
  getStats,
  getScams,
  verifyScam,
  rejectScam,
  deleteScam
} = require('../controllers/adminController');

// 获取统计数据
router.get('/dashboard', adminAuth, getStats);

// 获取用户列表
router.get('/users', adminAuth, getUsers);

// 更新用户信息
router.put('/users/:id', adminAuth, updateUser);

// 删除用户
router.delete('/users/:id', adminAuth, deleteUser);

// 获取内容列表
router.get('/scams', adminAuth, getScams);

// 审核通过内容
router.put('/scams/:id/verify', adminAuth, verifyScam);

// 拒绝内容
router.put('/scams/:id/reject', adminAuth, rejectScam);

// 删除内容
router.delete('/scams/:id', adminAuth, deleteScam);

module.exports = router; 